home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / fm2_246.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-06-02  |  49KB  |  1,208 lines

  1. /*
  2.  * FM/2 2.x installation program copyright (c) 1994/96 by M. Kimes
  3.  *
  4.  * This program creates folders to hold program and data objects,
  5.  * then creates program objects for each executable.  It only needs to be
  6.  * run once (unless you move the FM/2 directory -- see say notes at end).
  7.  * Run this program in the FM/2 directory (where you unpacked the archive).
  8.  *
  9.  * For unattended installation, remove the lines marked with "NOTE:" below.
  10.  */
  11.  
  12. /* see if we might be in the right directory... */
  13.  
  14. '@Echo off'
  15. 'cls'
  16.  
  17. say'     ┌───────────────────────────────────────────────────────────────────┐'
  18. say'     │                  FM/2 2.x Installation Program                    │'
  19. say'     │             FM/2 is copyright (c) 1993-96 by M. Kimes             │'
  20. say'     │                       All rights reserved                         │'
  21. say'     ├───────────────────────────────────────────────────────────────────┤'
  22. say'     ├───────────────────────────────────────────────────────────────────┤'
  23. say'     │                Have you read the READ.ME file yet?                │'
  24. say'     │        By running this program, you agree to the license          │'
  25. say'     │                     as specified in that file,                    │'
  26. say'     │      and it tells you how to install, so you should read it.      │'
  27. say'     │                             Please?                               │'
  28. say'     └───────────────────────────────────────────────────────────────────┘'
  29.  
  30. /*
  31.  * allow user to eliminate associations from being placed on AV/2.
  32.  * seemed to upset some fellow on CIS (I guess he doesn't know about
  33.  * Settings notebooks on WPS objects).
  34.  */
  35. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  36. existed = ''
  37. parse upper arg dummy
  38. if dummy = 'NOASSOC' then assocfilter = ''
  39.  
  40. rc = stream('fm3.exe','c','query exists')
  41. if rc = '' then
  42. do
  43.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  44.   exit
  45. end
  46.  
  47. /* tell user what we're doing, give him a chance to hit CTRL-C */
  48.  
  49. say ''
  50. say 'This program creates objects for FM/2 and does some drudgework for you.'
  51. say ''
  52.  
  53. /* load rexx utility functions */
  54.  
  55. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  56. call SysLoadFuncs
  57.  
  58. /* NOTE:  remove following 6 lines for unattended use... */
  59. call charout ,'  Press [Enter] to continue...'
  60. dummy = ''
  61. do until dummy = '0d'x
  62.   dummy = SysGetKey('NOECHO')
  63. end
  64. call charout ,'0d1b'x'[K'
  65.  
  66. /* save current directory */
  67.  
  68. curdir = directory()
  69.  
  70. /* say it, then do it */
  71.  
  72. say "Creating File Manager/2 folders and objects..."
  73.  
  74. /* first, create FM/2 folder */
  75.  
  76. rc = stream('fm2fldr.ico','c','query exists')
  77. title = "File Manager/2"
  78. classname = 'WPFolder'
  79. location = '<WP_DESKTOP>'
  80. setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
  81. if rc \= '' then setup = setup';ICONFILE='rc
  82. result = SysCreateObject(classname,title,location,setup,f)
  83. if rc \= '' then
  84. do
  85.   'DEL 'rc' 1>NUL 2>NUL'
  86. end
  87.  
  88. /* NOTE:  remove following 18 lines for unattended use... */
  89. if result = 0 then
  90. do
  91.   assocfilter = ''
  92.   existed = 'TRUE'
  93.   say ''
  94.   say 'The File Manager/2 folder already exists.'
  95.   call charout ,"Should I update the objects (it's painless)? (Y/N) "
  96.   dummy = ''
  97.   do forever
  98.     dummy = SysGetKey('NOECHO')
  99.     parse upper var dummy dummy
  100.     if dummy = '1b'x then dummy = 'N'
  101.     if dummy = '0d'x then dummy = 'Y'
  102.     if dummy = 'N' then leave
  103.     if dummy = 'Y' then leave
  104.   end
  105.   call charout ,dummy
  106.   say ''
  107.   if dummy = 'N' then exit
  108. end
  109.  
  110. /* create objects in appropriate folders */
  111.  
  112. rc = stream('fm3.exe','c','query exists')
  113. if rc \= '' then
  114. do
  115.   title = "FM/2"
  116.   classname = 'WPProgram'
  117.   location = '<FM3_Folder>'
  118.   setup = 'OBJECTID=<FM/2>;EXENAME='rc';STARTUPDIR='curdir
  119.   if existed = '' then setup = setup';PARAMETERS=%*'
  120.   call SysCreateObject classname,title,location,setup,u
  121. end
  122.  
  123. rc = stream('fm4.exe','c','query exists')
  124. if rc \= '' then
  125. do
  126.   title = "FM/2 Lite"
  127.   classname = 'WPProgram'
  128.   location = '<FM3_Folder>'
  129.   setup = 'OBJECTID=<FM/2 LITE>;EXENAME='rc';STARTUPDIR='curdir
  130.   if existed = '' then setup = setup';PARAMETERS=%*'
  131.   call SysCreateObject classname,title,location,setup,u
  132. end
  133.  
  134. /* create toolbox folder in FM/2 folder */
  135. rc = stream('toolbox.ico','c','query exists')
  136. title = "FM/2 Tools"
  137. classname = 'WPFolder'
  138. location = '<FM3_Folder>'
  139. setup = 'OBJECTID=<FM3_Tools>;OPEN=DEFAULT'
  140. if rc \= '' then setup = setup';ICONFILE='rc
  141. result = SysCreateObject(classname,title,location,setup,u)
  142. if rc \= '' then
  143. do
  144.   'DEL 'rc' 1>NUL 2>NUL'
  145. end
  146.  
  147. rc = stream('av2.exe','c','query exists')
  148. if rc \= '' then
  149. do
  150.   title = "Archive Viewer/2"
  151.   classname = 'WPProgram'
  152.   location = '<FM3_Tools>'
  153.   setup = 'OBJECTID=<FM/2_AV/2>;EXENAME='rc';STARTUPDIR='curdir''assocfilter
  154.   if existed = '' then setup = setup';PARAMETERS=%*'
  155.   call SysCreateObject classname,title,location,setup,u
  156. end
  157.  
  158. rc = stream('eas.exe','c','query exists')
  159. if rc \= '' then
  160. do
  161.   title = "EA Viewer"
  162.   classname = 'WPProgram'
  163.   location = '<FM3_Tools>'
  164.   setup = 'OBJECTID=<FM/2_EAVIEW>;EXENAME='rc';STARTUPDIR='curdir
  165.   if existed = '' then setup = setup';PARAMETERS=%*'
  166.   call SysCreateObject classname,title,location,setup,u
  167. end
  168.  
  169. rc = stream('dirsize.exe','c','query exists')
  170. if rc \= '' then
  171. do
  172.   title = "Dir Sizes"
  173.   classname = 'WPProgram'
  174.   location = '<FM3_Tools>'
  175.   setup = 'OBJECTID=<FM/2_DIRSIZE>;EXENAME='rc';STARTUPDIR='curdir
  176.   if existed = '' then setup = setup';PARAMETERS=%*'
  177.   call SysCreateObject classname,title,location,setup,u
  178. end
  179.  
  180. rc = stream('makearc.exe','c','query exists')
  181. if rc \= '' then
  182. do
  183.   title = "Make Archive"
  184.   classname = 'WPProgram'
  185.   location = '<FM3_Tools>'
  186.   setup = 'OBJECTID=<FM/2_MAKEARC>;EXENAME='rc';STARTUPDIR='curdir
  187.   if existed = '' then setup = setup';PARAMETERS=%*'
  188.   call SysCreateObject classname,title,location,setup,u
  189. end
  190.  
  191. rc = stream('ini.exe','c','query exists')
  192. if rc \= '' then
  193. do
  194.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  195.   title = "INI Viewer"
  196.   classname = 'WPProgram'
  197.   location = '<FM3_Tools>'
  198.   setup = 'OBJECTID=<FM/2_INIVIEW>;EXENAME='rc';STARTUPDIR='curdir''assocfilter
  199.   if existed = '' then setup = setup';PARAMETERS=%*'
  200.   call SysCreateObject classname,title,location,setup,u
  201. end
  202.  
  203. rc = stream('viewinfs.exe','c','query exists')
  204. if rc \= '' then
  205. do
  206.   title = "Bookshelf Viewer"
  207.   classname = 'WPProgram'
  208.   location = '<FM3_Tools>'
  209.   setup = 'OBJECTID=<FM/2_BOOKSHELF>;EXENAME='rc';STARTUPDIR='curdir
  210.   call SysCreateObject classname,title,location,setup,u
  211.   title = "Helpfile Viewer"
  212.   classname = 'WPProgram'
  213.   location = '<FM3_Tools>'
  214.   setup = 'EXENAME='rc';PARAMETERS=DUMMY;STARTUPDIR='curdir
  215.   call SysCreateObject classname,title,location,setup,u
  216. end
  217.  
  218. rc = stream('killproc.exe','c','query exists')
  219. if rc \= '' then
  220. do
  221.   title = "Process Killer"
  222.   classname = 'WPProgram'
  223.   location = '<FM3_Tools>'
  224.   setup = 'OBJECTID=<FM/2_KILLPROC>;EXENAME='rc';PARAMETERS=%;STARTUPDIR='curdir
  225.   call SysCreateObject classname,title,location,setup,u
  226. end
  227.  
  228. rc = stream('undel.exe','c','query exists')
  229. if rc \= '' then
  230. do
  231.   title = "Undeleter"
  232.   classname = 'WPProgram'
  233.   location = '<FM3_Tools>'
  234.   setup = 'OBJECTID=<FM/2_UNDEL>;EXENAME='rc';STARTUPDIR='curdir
  235.   if existed = '' then setup = setup';PARAMETERS=%*'
  236.   call SysCreateObject classname,title,location,setup,u
  237. end
  238.  
  239. rc = stream('vtree.exe','c','query exists')
  240. if rc \= '' then
  241. do
  242.   title = "Visual Tree"
  243.   classname = 'WPProgram'
  244.   location = '<FM3_Tools>'
  245.   setup = 'OBJECTID=<FM/2_VTREE>;EXENAME='rc';STARTUPDIR='curdir
  246.   call SysCreateObject classname,title,location,setup,u
  247. end
  248.  
  249. rc = stream('vdir.exe','c','query exists')
  250. if rc \= '' then
  251. do
  252.   title = "Visual Directory"
  253.   classname = 'WPProgram'
  254.   location = '<FM3_Tools>'
  255.   setup = 'OBJECTID=<FM/2_VDIR>;EXENAME='rc';STARTUPDIR='curdir
  256.   if existed = '' then setup = setup';PARAMETERS=%*'
  257.   call SysCreateObject classname,title,location,setup,u
  258. end
  259.  
  260. rc = stream('vcollect.exe','c','query exists')
  261. if rc \= '' then
  262. do
  263.   title = "Collector"
  264.   classname = 'WPProgram'
  265.   location = '<FM3_Tools>'
  266.   setup = 'OBJECTID=<FM/2_VCOLLECT>;EXENAME='rc';STARTUPDIR='curdir
  267.   call SysCreateObject classname,title,location,setup,u
  268.   title = "Seek and scan"
  269.   classname = 'WPProgram'
  270.   location = '<FM3_Tools>'
  271.   setup = 'OBJECTID=<FM/2_VSEEK>;EXENAME='rc';PARAMETERS=**;STARTUPDIR='curdir
  272.   call SysCreateObject classname,title,location,setup,u
  273. end
  274.  
  275. rc = stream('global.exe','c','query exists')
  276. if rc \= '' then
  277. do
  278.   title = "Global File Viewer"
  279.   classname = 'WPProgram'
  280.   location = '<FM3_Tools>'
  281.   setup = 'OBJECTID=<FM/2_SEEALL>;EXENAME='rc';STARTUPDIR='curdir
  282.   call SysCreateObject classname,title,location,setup,u
  283. end
  284.  
  285. rc = stream('databar.exe','c','query exists')
  286. if rc \= '' then
  287. do
  288.   title = "Databar"
  289.   classname = 'WPProgram'
  290.   location = '<FM3_Tools>'
  291.   setup = 'OBJECTID=<FM/2_DATABAR>;EXENAME='rc';STARTUPDIR='curdir
  292.   call SysCreateObject classname,title,location,setup,u
  293. end
  294.  
  295. rc = stream('sysinfo.exe','c','query exists')
  296. if rc \= '' then
  297. do
  298.   title = "SysInfo"
  299.   classname = 'WPProgram'
  300.   location = '<FM3_Tools>'
  301.   setup = 'OBJECTID=<FM/2_SYSINFO>;EXENAME='rc';STARTUPDIR='curdir
  302.   call SysCreateObject classname,title,location,setup,u
  303. end
  304.  
  305. rc = stream('READ.ME','c','query exists')
  306. if rc \= '' then
  307. do
  308.   title = "Read.Me"
  309.   classname = 'WPShadow'
  310.   location = '<FM3_Folder>'
  311.   setup = 'SHADOWID='rc
  312.   call SysCreateObject classname,title,location,setup,u
  313. end
  314.  
  315. rc = stream('HISTORY.TXT','c','query exists')
  316. if rc \= '' then
  317. do
  318.   title = "History.Txt"
  319.   classname = 'WPShadow'
  320.   location = '<FM3_Folder>'
  321.   setup = 'SHADOWID='rc
  322.   call SysCreateObject classname,title,location,setup,u
  323. end
  324.  
  325. rc = stream('REGISTER.TXT','c','query exists')
  326. if rc \= '' then
  327. do
  328.   title = "Register.Txt"
  329.   classname = 'WPShadow'
  330.   location = '<FM3_Folder>'
  331.   setup = 'SHADOWID='rc
  332.   call SysCreateObject classname,title,location,setup,u
  333. end
  334.  
  335. rc = stream('FM3.HLP','c','query exists')
  336. if rc \= '' then
  337. do
  338.   if assocfilter \= '' then assocfilter=';ASSOCFILTER=*.HLP'
  339.   rc = stream('SEEHELP.EXE','c','query exists')
  340.   if rc \= '' then
  341.   do
  342.     title = "FM/2 Online Help"
  343.     classname = 'WPProgram'
  344.     location = '<FM3_Folder>'
  345.     setup = 'EXENAME='rc';STARTUPDIR='curdir';PARAMETERS= %* 'curdir'\FM3.HLP'
  346.     call SysCreateObject classname,title,location,setup,u
  347.   end
  348. end
  349.  
  350. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  351. if rc \= '' then
  352. do
  353.   title = "Make Object"
  354.   classname = 'WPProgram'
  355.   location = '<FM3_Tools>'
  356.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=%*'
  357.   call SysCreateObject classname,title,location,setup,u
  358. end
  359.  
  360. rc = stream('UTILS\FM2UTILS.DOC','c','query exists')
  361. if rc \= '' then
  362. do
  363.   title = "FM2UTILS.DOC"
  364.   classname = 'WPShadow'
  365.   location = '<FM3_Tools>'
  366.   setup = 'SHADOWID='rc
  367.   call SysCreateObject classname,title,location,setup,u
  368. end
  369.  
  370. /* create sample customizations for the user so they don't start 'blank' */
  371.  
  372. rc = stream('FM3MENU.DAT','c','query exists')
  373. if rc = '' then
  374. do
  375.   rc = stream('FM2MENU.TMP','c','query exists')
  376.   if rc \= '' then
  377.   do
  378.     say 'Creating a sample FM3MENU.DAT file for you.'
  379.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  380.   end
  381. end
  382. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  383. rc = stream('ASSOC.DAT','c','query exists')
  384. if rc = '' then
  385. do
  386.   rc = stream('ASSOC.TMP','c','query exists')
  387.   if rc \= '' then
  388.   do
  389.     say 'Creating a sample ASSOC.DAT file for you.'
  390.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  391.   end
  392. end
  393. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  394. rc = stream('COMMANDS.DAT','c','query exists')
  395. if rc = '' then
  396. do
  397.   rc = stream('COMMANDS.TMP','c','query exists')
  398.   if rc \= '' then
  399.   do
  400.     say 'Creating a sample COMMANDS.DAT file for you.'
  401.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  402.   end
  403. end
  404. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  405. rc = stream('FILTERS.DAT','c','query exists')
  406. if rc = '' then
  407. do
  408.   rc = stream('FILTERS.TMP','c','query exists')
  409.   if rc \= '' then
  410.   do
  411.     say 'Creating a sample FILTERS.DAT file for you.'
  412.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  413.   end
  414. end
  415. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  416. rc = stream('FM3TOOLS.DAT','c','query exists')
  417. if rc = '' then
  418. do
  419.   rc = stream('FM3TOOLS.TMP','c','query exists')
  420.   if rc \= '' then
  421.   do
  422.     say 'Installing an FM3TOOLS.DAT file for you.'
  423.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  424.   end
  425. end
  426. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  427. rc = stream('QUICKTLS.DAT','c','query exists')
  428. if rc = '' then
  429. do
  430.   rc = stream('QUICKTLS.TMP','c','query exists')
  431.   if rc \= '' then
  432.   do
  433.     rc = stream('CMDS.TMP','c','query exists')
  434.     if rc \= '' then
  435.     do
  436.       rc = stream('UTILS.TMP','c','query exists')
  437.       if rc \= '' then
  438.       do
  439.         rc = stream('SORT.TMP','c','query exists')
  440.         if rc \= '' then
  441.         do
  442.           rc = stream('SELECT.TMP','c','query exists')
  443.           if rc \= '' then
  444.           do
  445.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  446.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  447.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  448.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  449.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  450.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  451.           end
  452.           'DEL SELECT.TMP 1>NUL 2>NUL'
  453.         end
  454.        'DEL SORT.TMP 1>NUL 2>NUL'
  455.       end
  456.       'DEL UTILS.TMP 1>NUL 2>NUL'
  457.     end
  458.     'DEL CMDS.TMP 1>NUL 2>NUL'
  459.   end
  460. end
  461. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  462.  
  463. /*
  464.  * create command files that the user can execute from anywhere (we'll
  465.  * ask the user to put this utils directory on the PATH) and that other
  466.  * programs can execute to use FM/2 as "their" file manager.
  467.  */
  468.  
  469. 'del SETENV.CMD 1>NUL 2>NUL'
  470. dummy = stream('SETENV.CMD','C','open')
  471. if dummy = 'READY:' then
  472. do
  473.   call lineout 'SETENV.CMD','@ECHO OFF'
  474.   call lineout 'SETENV.CMD','REM'
  475.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  476.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  477.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  478.   call lineout 'SETENV.CMD','REM command line utilities.'
  479.   call lineout 'SETENV.CMD','REM'
  480.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  481.   call lineout 'SETENV.CMD','GOTO SKIP'
  482.   call lineout 'SETENV.CMD',':INSTALL'
  483.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  484.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  485.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  486.   call lineout 'SETENV.CMD','GOTO END'
  487.   call lineout 'SETENV.CMD',':SKIP'
  488.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  489.   call lineout 'SETENV.CMD',':END'
  490.   call stream 'SETENV.CMD','C','close'
  491. end
  492.  
  493. /*
  494.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  495.  * their PATH statement if they don't want to for command line work.
  496.  */
  497.  
  498.  
  499. rc = stream('SETENV.CMD','c','query exists')
  500. if rc \= '' then
  501. do
  502.   dummy = value('COMSPEC',,'OS2ENVIRONMENT')
  503.   if dummy = '' then dummy = value('OS2_SHELL',,'OS2ENVIRONMENT')
  504.   if dummy = '' then dummy = 'CMD.EXE'
  505.   title = "FM/2 Utilities command line"
  506.   classname = 'WPProgram'
  507.   location = '<FM3_Tools>'
  508.   setup = 'EXENAME='dummy';PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  509.   call SysCreateObject classname,title,location,setup,u
  510. end
  511.  
  512. call SysMkDir curdir'\UTILS'
  513. dummy = directory(curdir'\UTILS')
  514. if dummy = curdir'\UTILS' then
  515. do
  516.   'set PATH=%PATH%;'curdir'\utils'
  517.   'move ..\example.cmd 1>NUL 2>NUL'
  518.   'del FM2.CMD 1>NUL 2>NUL'
  519.   dummy = stream('FM2.CMD','C','open')
  520.   if dummy = 'READY:' then
  521.   do
  522.     say 'Creating an FM2.CMD file.'
  523.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  524.     call lineout 'FM2.CMD', " * on your PATH. */"
  525.     call lineout 'FM2.CMD', "'@echo off'"
  526.       call lineout 'FM2.CMD', "mydir = directory()"
  527.       call lineout 'FM2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  528.       call lineout 'FM2.CMD', "if arg1 \= '' then "
  529.       call lineout 'FM2.CMD', "do"
  530.       call lineout 'FM2.CMD', "  if left(arg1,1,1) \= '/' then"
  531.       call lineout 'FM2.CMD', "  do"
  532.       call lineout 'FM2.CMD', "    arg0 = arg1"
  533.       call lineout 'FM2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  534.       call lineout 'FM2.CMD', "    if arg1 = '' then"
  535.       call lineout 'FM2.CMD', "    do"
  536.       call lineout 'FM2.CMD', "      arg1 = directory(arg0)"
  537.       call lineout 'FM2.CMD', "      call directory mydir"
  538.       call lineout 'FM2.CMD', "    end"
  539.       call lineout 'FM2.CMD', "  end"
  540.       call lineout 'FM2.CMD', "end"
  541.       call lineout 'FM2.CMD', "else arg1 = mydir"
  542.       call lineout 'FM2.CMD', "if arg2 \= '' then "
  543.       call lineout 'FM2.CMD', "do"
  544.       call lineout 'FM2.CMD', "  if left(arg2,1,1) \= '/' then"
  545.       call lineout 'FM2.CMD', "  do"
  546.       call lineout 'FM2.CMD', "    arg0 = arg2"
  547.       call lineout 'FM2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  548.       call lineout 'FM2.CMD', "    if arg2 = '' then"
  549.       call lineout 'FM2.CMD', "    do"
  550.       call lineout 'FM2.CMD', "      arg2 = directory(arg0)"
  551.       call lineout 'FM2.CMD', "      call directory mydir"
  552.       call lineout 'FM2.CMD', "    end"
  553.       call lineout 'FM2.CMD', "  end"
  554.       call lineout 'FM2.CMD', "end"
  555.       call lineout 'FM2.CMD', "if arg3 \= '' then "
  556.       call lineout 'FM2.CMD', "do"
  557.       call lineout 'FM2.CMD', "  if left(arg3,1,1) \= '/' then"
  558.       call lineout 'FM2.CMD', "  do"
  559.       call lineout 'FM2.CMD', "    arg0 = arg3"
  560.       call lineout 'FM2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  561.       call lineout 'FM2.CMD', "    if arg3 = '' then"
  562.       call lineout 'FM2.CMD', "    do"
  563.       call lineout 'FM2.CMD', "      arg3 = directory(arg0)"
  564.       call lineout 'FM2.CMD', "      call directory mydir"
  565.       call lineout 'FM2.CMD', "    end"
  566.       call lineout 'FM2.CMD', "  end"
  567.       call lineout 'FM2.CMD', "end"
  568.       call lineout 'FM2.CMD', "if arg4 \= '' then "
  569.       call lineout 'FM2.CMD', "do"
  570.       call lineout 'FM2.CMD', "  if left(arg4,1,1) \= '/' then"
  571.       call lineout 'FM2.CMD', "  do"
  572.       call lineout 'FM2.CMD', "    arg0 = arg4"
  573.       call lineout 'FM2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  574.       call lineout 'FM2.CMD', "    if arg4 = '' then"
  575.       call lineout 'FM2.CMD', "    do"
  576.       call lineout 'FM2.CMD', "      arg4 = directory(arg0)"
  577.       call lineout 'FM2.CMD', "      call directory mydir"
  578.       call lineout 'FM2.CMD', "    end"
  579.       call lineout 'FM2.CMD', "  end"
  580.       call lineout 'FM2.CMD', "end"
  581.       call lineout 'FM2.CMD', "if arg5 \= '' then "
  582.       call lineout 'FM2.CMD', "do"
  583.       call lineout 'FM2.CMD', "  if left(arg5,1,1) \= '/' then"
  584.       call lineout 'FM2.CMD', "  do"
  585.       call lineout 'FM2.CMD', "    arg0 = arg5"
  586.       call lineout 'FM2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  587.       call lineout 'FM2.CMD', "    if arg5 = '' then"
  588.       call lineout 'FM2.CMD', "    do"
  589.       call lineout 'FM2.CMD', "      arg5 = directory(arg0)"
  590.       call lineout 'FM2.CMD', "      call directory mydir"
  591.       call lineout 'FM2.CMD', "    end"
  592.       call lineout 'FM2.CMD', "  end"
  593.       call lineout 'FM2.CMD', "end"
  594.       call lineout 'FM2.CMD', "if arg6 \= '' then "
  595.       call lineout 'FM2.CMD', "do"
  596.       call lineout 'FM2.CMD', "  if left(arg6,1,1) \= '/' then"
  597.       call lineout 'FM2.CMD', "  do"
  598.       call lineout 'FM2.CMD', "    arg0 = arg6"
  599.       call lineout 'FM2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  600.       call lineout 'FM2.CMD', "    if arg6 = '' then"
  601.       call lineout 'FM2.CMD', "    do"
  602.       call lineout 'FM2.CMD', "      arg6 = directory(arg0)"
  603.       call lineout 'FM2.CMD', "      call directory mydir"
  604.       call lineout 'FM2.CMD', "    end"
  605.       call lineout 'FM2.CMD', "  end"
  606.       call lineout 'FM2.CMD', "end"
  607.       call lineout 'FM2.CMD', "if arg7 \= '' then "
  608.       call lineout 'FM2.CMD', "do"
  609.       call lineout 'FM2.CMD', "  if left(arg7,1,1) \= '/' then"
  610.       call lineout 'FM2.CMD', "  do"
  611.       call lineout 'FM2.CMD', "    arg0 = arg7"
  612.       call lineout 'FM2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  613.       call lineout 'FM2.CMD', "    if arg7 = '' then"
  614.       call lineout 'FM2.CMD', "    do"
  615.       call lineout 'FM2.CMD', "      arg7 = directory(arg0)"
  616.       call lineout 'FM2.CMD', "      call directory mydir"
  617.       call lineout 'FM2.CMD', "    end"
  618.       call lineout 'FM2.CMD', "  end"
  619.       call lineout 'FM2.CMD', "end"
  620.       call lineout 'FM2.CMD', "if arg8 \= '' then "
  621.       call lineout 'FM2.CMD', "do"
  622.       call lineout 'FM2.CMD', "  if left(arg8,1,1) \= '/' then"
  623.       call lineout 'FM2.CMD', "  do"
  624.       call lineout 'FM2.CMD', "    arg0 = arg8"
  625.       call lineout 'FM2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  626.       call lineout 'FM2.CMD', "    if arg8 = '' then"
  627.       call lineout 'FM2.CMD', "    do"
  628.       call lineout 'FM2.CMD', "      arg8 = directory(arg0)"
  629.       call lineout 'FM2.CMD', "      call directory mydir"
  630.       call lineout 'FM2.CMD', "    end"
  631.       call lineout 'FM2.CMD', "  end"
  632.       call lineout 'FM2.CMD', "end"
  633.       call lineout 'FM2.CMD', "if arg9 \= '' then "
  634.       call lineout 'FM2.CMD', "do"
  635.       call lineout 'FM2.CMD', "  if left(arg9,1,1) \= '/' then"
  636.       call lineout 'FM2.CMD', "  do"
  637.       call lineout 'FM2.CMD', "    arg0 = arg9"
  638.       call lineout 'FM2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  639.       call lineout 'FM2.CMD', "    if arg9 = '' then"
  640.       call lineout 'FM2.CMD', "    do"
  641.       call lineout 'FM2.CMD', "      arg9 = directory(arg0)"
  642.       call lineout 'FM2.CMD', "      call directory mydir"
  643.       call lineout 'FM2.CMD', "    end"
  644.       call lineout 'FM2.CMD', "  end"
  645.       call lineout 'FM2.CMD', "end"
  646.     call lineout 'FM2.CMD', "n = setlocal()"
  647.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  648.     call lineout 'FM2.CMD', "'start fm3.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  649.     call lineout 'FM2.CMD', "n = endlocal()"
  650.     call stream 'FM2.CMD','C','close'
  651.     'del AV2.CMD 1>NUL 2>NUL'
  652.     dummy = stream('AV2.CMD','C','open')
  653.     if dummy = 'READY:' then
  654.     do
  655.       say 'Creating an AV2.CMD file.'
  656.       call lineout 'AV2.CMD', "/* AV/2 command file.  Locate in a directory"
  657.       call lineout 'AV2.CMD', " * on your PATH. */"
  658.       call lineout 'AV2.CMD', "'@echo off'"
  659.       call lineout 'AV2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  660.       call lineout 'AV2.CMD', "if arg1 \= '' then "
  661.       call lineout 'AV2.CMD', "do"
  662.       call lineout 'AV2.CMD', "  if left(arg1,1,1) \= '/' then"
  663.       call lineout 'AV2.CMD', "  do"
  664.       call lineout 'AV2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  665.       call lineout 'AV2.CMD', "  end"
  666.       call lineout 'AV2.CMD', "end"
  667.       call lineout 'AV2.CMD', "else arg1 = directory()"
  668.       call lineout 'AV2.CMD', "if arg2 \= '' then "
  669.       call lineout 'AV2.CMD', "do"
  670.       call lineout 'AV2.CMD', "  if left(arg2,1,1) \= '/' then"
  671.       call lineout 'AV2.CMD', "  do"
  672.       call lineout 'AV2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  673.       call lineout 'AV2.CMD', "  end"
  674.       call lineout 'AV2.CMD', "end"
  675.       call lineout 'AV2.CMD', "if arg3 \= '' then "
  676.       call lineout 'AV2.CMD', "do"
  677.       call lineout 'AV2.CMD', "  if left(arg3,1,1) \= '/' then"
  678.       call lineout 'AV2.CMD', "  do"
  679.       call lineout 'AV2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  680.       call lineout 'AV2.CMD', "  end"
  681.       call lineout 'AV2.CMD', "end"
  682.       call lineout 'AV2.CMD', "if arg4 \= '' then "
  683.       call lineout 'AV2.CMD', "do"
  684.       call lineout 'AV2.CMD', "  if left(arg4,1,1) \= '/' then"
  685.       call lineout 'AV2.CMD', "  do"
  686.       call lineout 'AV2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  687.       call lineout 'AV2.CMD', "  end"
  688.       call lineout 'AV2.CMD', "end"
  689.       call lineout 'AV2.CMD', "if arg5 \= '' then "
  690.       call lineout 'AV2.CMD', "do"
  691.       call lineout 'AV2.CMD', "  if left(arg5,1,1) \= '/' then"
  692.       call lineout 'AV2.CMD', "  do"
  693.       call lineout 'AV2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  694.       call lineout 'AV2.CMD', "  end"
  695.       call lineout 'AV2.CMD', "end"
  696.       call lineout 'AV2.CMD', "if arg6 \= '' then "
  697.       call lineout 'AV2.CMD', "do"
  698.       call lineout 'AV2.CMD', "  if left(arg6,1,1) \= '/' then"
  699.       call lineout 'AV2.CMD', "  do"
  700.       call lineout 'AV2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  701.       call lineout 'AV2.CMD', "  end"
  702.       call lineout 'AV2.CMD', "end"
  703.       call lineout 'AV2.CMD', "if arg7 \= '' then "
  704.       call lineout 'AV2.CMD', "do"
  705.       call lineout 'AV2.CMD', "  if left(arg7,1,1) \= '/' then"
  706.       call lineout 'AV2.CMD', "  do"
  707.       call lineout 'AV2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  708.       call lineout 'AV2.CMD', "  end"
  709.       call lineout 'AV2.CMD', "end"
  710.       call lineout 'AV2.CMD', "if arg8 \= '' then "
  711.       call lineout 'AV2.CMD', "do"
  712.       call lineout 'AV2.CMD', "  if left(arg8,1,1) \= '/' then"
  713.       call lineout 'AV2.CMD', "  do"
  714.       call lineout 'AV2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  715.       call lineout 'AV2.CMD', "  end"
  716.       call lineout 'AV2.CMD', "end"
  717.       call lineout 'AV2.CMD', "if arg9 \= '' then "
  718.       call lineout 'AV2.CMD', "do"
  719.       call lineout 'AV2.CMD', "  if left(arg9,1,1) \= '/' then"
  720.       call lineout 'AV2.CMD', "  do"
  721.       call lineout 'AV2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  722.       call lineout 'AV2.CMD', "  end"
  723.       call lineout 'AV2.CMD', "end"
  724.       call lineout 'AV2.CMD', "n = setlocal()"
  725.       call lineout 'AV2.CMD', "n = directory('"curdir"')"
  726.       call lineout 'AV2.CMD', "'start av2.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  727.       call lineout 'AV2.CMD', "n = endlocal()"
  728.       call stream 'AV2.CMD','C','close'
  729.     end
  730.     else say "Couldn't create AV2.CMD file."
  731.     'del VDIR.CMD 1>NUL 2>NUL'
  732.     dummy = stream('VDIR.CMD','C','open')
  733.     if dummy = 'READY:' then
  734.     do
  735.       say 'Creating a VDIR.CMD file.'
  736.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  737.       call lineout 'VDIR.CMD', " * on your PATH. */"
  738.       call lineout 'VDIR.CMD', "'@echo off'"
  739.       call lineout 'VDIR.CMD', "mydir = directory()"
  740.       call lineout 'VDIR.CMD', "arg arg1 arg2"
  741.       call lineout 'VDIR.CMD', "if arg1 \= '' then "
  742.       call lineout 'VDIR.CMD', "do"
  743.       call lineout 'VDIR.CMD', "  if left(arg1,1,1) \= '/' then"
  744.       call lineout 'VDIR.CMD', "  do"
  745.       call lineout 'VDIR.CMD', "    arg0 = arg1"
  746.       call lineout 'VDIR.CMD', "    arg1 = stream(arg1,'c','query exists')"
  747.       call lineout 'VDIR.CMD', "    if arg1 = '' then"
  748.       call lineout 'VDIR.CMD', "    do"
  749.       call lineout 'VDIR.CMD', "      arg1 = directory(arg0)"
  750.       call lineout 'VDIR.CMD', "      call directory mydir"
  751.       call lineout 'VDIR.CMD', "    end"
  752.       call lineout 'VDIR.CMD', "  end"
  753.       call lineout 'VDIR.CMD', "end"
  754.       call lineout 'VDIR.CMD', "else arg1 = mydir"
  755.       call lineout 'VDIR.CMD', "n = setlocal()"
  756.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  757.       call lineout 'VDIR.CMD', "'start vdir.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  758.       call lineout 'VDIR.CMD', "n = endlocal()"
  759.       call stream 'VDIR.CMD','C','close'
  760.     end
  761.     else say "Couldn't create VDIR.CMD file."
  762.     'del VTREE.CMD 1>NUL 2>NUL'
  763.     dummy = stream('VTREE.CMD','C','open')
  764.     if dummy = 'READY:' then
  765.     do
  766.       say 'Creating a VTREE.CMD file.'
  767.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  768.       call lineout 'VTREE.CMD', " * on your PATH. */"
  769.       call lineout 'VTREE.CMD', "'@echo off'"
  770.       call lineout 'VTREE.CMD', "n = setlocal()"
  771.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  772.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  773.       call lineout 'VTREE.CMD', "n = endlocal()"
  774.       call stream 'VTREE.CMD','C','close'
  775.     end
  776.     else say "Couldn't create VTREE.CMD file."
  777.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  778.     dummy = stream('VCOLLECT.CMD','C','open')
  779.     if dummy = 'READY:' then
  780.     do
  781.       say 'Creating a VCOLLECT.CMD file.'
  782.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  783.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  784.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  785.       call lineout 'VCOLLECT.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  786.       call lineout 'VCOLLECT.CMD', "if arg1 \= '' then "
  787.       call lineout 'VCOLLECT.CMD', "do"
  788.       call lineout 'VCOLLECT.CMD', "  if left(arg1,1,1) \= '/' then"
  789.       call lineout 'VCOLLECT.CMD', "  do"
  790.       call lineout 'VCOLLECT.CMD', "    arg1 = stream(arg1,'c','query exists')"
  791.       call lineout 'VCOLLECT.CMD', "  end"
  792.       call lineout 'VCOLLECT.CMD', "end"
  793.       call lineout 'VCOLLECT.CMD', "if arg2 \= '' then "
  794.       call lineout 'VCOLLECT.CMD', "do"
  795.       call lineout 'VCOLLECT.CMD', "  if left(arg2,1,1) \= '/' then"
  796.       call lineout 'VCOLLECT.CMD', "  do"
  797.       call lineout 'VCOLLECT.CMD', "    arg2 = stream(arg2,'c','query exists')"
  798.       call lineout 'VCOLLECT.CMD', "  end"
  799.       call lineout 'VCOLLECT.CMD', "end"
  800.       call lineout 'VCOLLECT.CMD', "if arg3 \= '' then "
  801.       call lineout 'VCOLLECT.CMD', "do"
  802.       call lineout 'VCOLLECT.CMD', "  if left(arg3,1,1) \= '/' then"
  803.       call lineout 'VCOLLECT.CMD', "  do"
  804.       call lineout 'VCOLLECT.CMD', "    arg3 = stream(arg3,'c','query exists')"
  805.       call lineout 'VCOLLECT.CMD', "  end"
  806.       call lineout 'VCOLLECT.CMD', "end"
  807.       call lineout 'VCOLLECT.CMD', "if arg4 \= '' then "
  808.       call lineout 'VCOLLECT.CMD', "do"
  809.       call lineout 'VCOLLECT.CMD', "  if left(arg4,1,1) \= '/' then"
  810.       call lineout 'VCOLLECT.CMD', "  do"
  811.       call lineout 'VCOLLECT.CMD', "    arg4 = stream(arg4,'c','query exists')"
  812.       call lineout 'VCOLLECT.CMD', "  end"
  813.       call lineout 'VCOLLECT.CMD', "end"
  814.       call lineout 'VCOLLECT.CMD', "if arg5 \= '' then "
  815.       call lineout 'VCOLLECT.CMD', "do"
  816.       call lineout 'VCOLLECT.CMD', "  if left(arg5,1,1) \= '/' then"
  817.       call lineout 'VCOLLECT.CMD', "  do"
  818.       call lineout 'VCOLLECT.CMD', "    arg5 = stream(arg5,'c','query exists')"
  819.       call lineout 'VCOLLECT.CMD', "  end"
  820.       call lineout 'VCOLLECT.CMD', "end"
  821.       call lineout 'VCOLLECT.CMD', "if arg6 \= '' then "
  822.       call lineout 'VCOLLECT.CMD', "do"
  823.       call lineout 'VCOLLECT.CMD', "  if left(arg6,1,1) \= '/' then"
  824.       call lineout 'VCOLLECT.CMD', "  do"
  825.       call lineout 'VCOLLECT.CMD', "    arg6 = stream(arg6,'c','query exists')"
  826.       call lineout 'VCOLLECT.CMD', "  end"
  827.       call lineout 'VCOLLECT.CMD', "end"
  828.       call lineout 'VCOLLECT.CMD', "if arg7 \= '' then "
  829.       call lineout 'VCOLLECT.CMD', "do"
  830.       call lineout 'VCOLLECT.CMD', "  if left(arg7,1,1) \= '/' then"
  831.       call lineout 'VCOLLECT.CMD', "  do"
  832.       call lineout 'VCOLLECT.CMD', "    arg7 = stream(arg7,'c','query exists')"
  833.       call lineout 'VCOLLECT.CMD', "  end"
  834.       call lineout 'VCOLLECT.CMD', "end"
  835.       call lineout 'VCOLLECT.CMD', "if arg8 \= '' then "
  836.       call lineout 'VCOLLECT.CMD', "do"
  837.       call lineout 'VCOLLECT.CMD', "  if left(arg8,1,1) \= '/' then"
  838.       call lineout 'VCOLLECT.CMD', "  do"
  839.       call lineout 'VCOLLECT.CMD', "    arg8 = stream(arg8,'c','query exists')"
  840.       call lineout 'VCOLLECT.CMD', "  end"
  841.       call lineout 'VCOLLECT.CMD', "end"
  842.       call lineout 'VCOLLECT.CMD', "if arg9 \= '' then "
  843.       call lineout 'VCOLLECT.CMD', "do"
  844.       call lineout 'VCOLLECT.CMD', "  if left(arg9,1,1) \= '/' then"
  845.       call lineout 'VCOLLECT.CMD', "  do"
  846.       call lineout 'VCOLLECT.CMD', "    arg9 = stream(arg9,'c','query exists')"
  847.       call lineout 'VCOLLECT.CMD', "  end"
  848.       call lineout 'VCOLLECT.CMD', "end"
  849.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  850.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  851.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  852.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  853.       call stream 'VCOLLECT.CMD','C','close'
  854.     end
  855.     else say "Couldn't create VCOLLECT.CMD file."
  856.     'del INI.CMD 1>NUL 2>NUL'
  857.     dummy = stream('INI.CMD','C','open')
  858.     if dummy = 'READY:' then
  859.     do
  860.       say 'Creating an INI.CMD file.'
  861.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  862.       call lineout 'INI.CMD', " * on your PATH. */"
  863.       call lineout 'INI.CMD', "'@echo off'"
  864.       call lineout 'INI.CMD', "arg arg1"
  865.       call lineout 'INI.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  866.       call lineout 'INI.CMD', "n = setlocal()"
  867.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  868.       call lineout 'INI.CMD', "'start INI.exe 'arg1"
  869.       call lineout 'INI.CMD', "n = endlocal()"
  870.       call stream 'INI.CMD','C','close'
  871.     end
  872.     else say "Couldn't create INI.CMD file."
  873.     'del EAS.CMD 1>NUL 2>NUL'
  874.     dummy = stream('EAS.CMD','C','open')
  875.     if dummy = 'READY:' then
  876.     do
  877.       say 'Creating an EAS.CMD file.'
  878.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  879.       call lineout 'EAS.CMD', " * on your PATH. */"
  880.       call lineout 'EAS.CMD', "'@echo off'"
  881.       call lineout 'EAS.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  882.       call lineout 'EAS.CMD', "if arg1 \= '' then "
  883.       call lineout 'EAS.CMD', "do"
  884.       call lineout 'EAS.CMD', "  if left(arg1,1,1) \= '/' then"
  885.       call lineout 'EAS.CMD', "  do"
  886.       call lineout 'EAS.CMD', "    arg1 = stream(arg1,'c','query exists')"
  887.       call lineout 'EAS.CMD', "  end"
  888.       call lineout 'EAS.CMD', "end"
  889.       call lineout 'EAS.CMD', "else arg1 = directory()"
  890.       call lineout 'EAS.CMD', "if arg2 \= '' then "
  891.       call lineout 'EAS.CMD', "do"
  892.       call lineout 'EAS.CMD', "  if left(arg2,1,1) \= '/' then"
  893.       call lineout 'EAS.CMD', "  do"
  894.       call lineout 'EAS.CMD', "    arg2 = stream(arg2,'c','query exists')"
  895.       call lineout 'EAS.CMD', "  end"
  896.       call lineout 'EAS.CMD', "end"
  897.       call lineout 'EAS.CMD', "if arg3 \= '' then "
  898.       call lineout 'EAS.CMD', "do"
  899.       call lineout 'EAS.CMD', "  if left(arg3,1,1) \= '/' then"
  900.       call lineout 'EAS.CMD', "  do"
  901.       call lineout 'EAS.CMD', "    arg3 = stream(arg3,'c','query exists')"
  902.       call lineout 'EAS.CMD', "  end"
  903.       call lineout 'EAS.CMD', "end"
  904.       call lineout 'EAS.CMD', "if arg4 \= '' then "
  905.       call lineout 'EAS.CMD', "do"
  906.       call lineout 'EAS.CMD', "  if left(arg4,1,1) \= '/' then"
  907.       call lineout 'EAS.CMD', "  do"
  908.       call lineout 'EAS.CMD', "    arg4 = stream(arg4,'c','query exists')"
  909.       call lineout 'EAS.CMD', "  end"
  910.       call lineout 'EAS.CMD', "end"
  911.       call lineout 'EAS.CMD', "if arg5 \= '' then "
  912.       call lineout 'EAS.CMD', "do"
  913.       call lineout 'EAS.CMD', "  if left(arg5,1,1) \= '/' then"
  914.       call lineout 'EAS.CMD', "  do"
  915.       call lineout 'EAS.CMD', "    arg5 = stream(arg5,'c','query exists')"
  916.       call lineout 'EAS.CMD', "  end"
  917.       call lineout 'EAS.CMD', "end"
  918.       call lineout 'EAS.CMD', "if arg6 \= '' then "
  919.       call lineout 'EAS.CMD', "do"
  920.       call lineout 'EAS.CMD', "  if left(arg6,1,1) \= '/' then"
  921.       call lineout 'EAS.CMD', "  do"
  922.       call lineout 'EAS.CMD', "    arg6 = stream(arg6,'c','query exists')"
  923.       call lineout 'EAS.CMD', "  end"
  924.       call lineout 'EAS.CMD', "end"
  925.       call lineout 'EAS.CMD', "if arg7 \= '' then "
  926.       call lineout 'EAS.CMD', "do"
  927.       call lineout 'EAS.CMD', "  if left(arg7,1,1) \= '/' then"
  928.       call lineout 'EAS.CMD', "  do"
  929.       call lineout 'EAS.CMD', "    arg7 = stream(arg7,'c','query exists')"
  930.       call lineout 'EAS.CMD', "  end"
  931.       call lineout 'EAS.CMD', "end"
  932.       call lineout 'EAS.CMD', "if arg8 \= '' then "
  933.       call lineout 'EAS.CMD', "do"
  934.       call lineout 'EAS.CMD', "  if left(arg8,1,1) \= '/' then"
  935.       call lineout 'EAS.CMD', "  do"
  936.       call lineout 'EAS.CMD', "    arg8 = stream(arg8,'c','query exists')"
  937.       call lineout 'EAS.CMD', "  end"
  938.       call lineout 'EAS.CMD', "end"
  939.       call lineout 'EAS.CMD', "if arg9 \= '' then "
  940.       call lineout 'EAS.CMD', "do"
  941.       call lineout 'EAS.CMD', "  if left(arg9,1,1) \= '/' then"
  942.       call lineout 'EAS.CMD', "  do"
  943.       call lineout 'EAS.CMD', "    arg9 = stream(arg9,'c','query exists')"
  944.       call lineout 'EAS.CMD', "  end"
  945.       call lineout 'EAS.CMD', "end"
  946.       call lineout 'EAS.CMD', "n = setlocal()"
  947.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  948.       call lineout 'EAS.CMD', "'start eas.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  949.       call lineout 'EAS.CMD', "n = endlocal()"
  950.       call stream 'EAS.CMD','C','close'
  951.     end
  952.     else say "Couldn't create EAS.CMD file."
  953.     'del DIRSIZE.CMD 1>NUL 2>NUL'
  954.     dummy = stream('DIRSIZE.CMD','C','open')
  955.     if dummy = 'READY:' then
  956.     do
  957.       say 'Creating a DIRSIZE.CMD file.'
  958.       call lineout 'DIRSIZE.CMD', "/* DIRSIZE (FM/2) command file.  Locate in a directory"
  959.       call lineout 'DIRSIZE.CMD', " * on your PATH. */"
  960.       call lineout 'DIRSIZE.CMD', "'@echo off'"
  961.       call lineout 'DIRSIZE.CMD', "mydir = directory()"
  962.       call lineout 'DIRSIZE.CMD', "arg arg1 arg2"
  963.       call lineout 'DIRSIZE.CMD', "if arg1 \= '' then "
  964.       call lineout 'DIRSIZE.CMD', "do"
  965.       call lineout 'DIRSIZE.CMD', "  if left(arg1,1,1) \= '/' then"
  966.       call lineout 'DIRSIZE.CMD', "  do"
  967.       call lineout 'DIRSIZE.CMD', "    arg0 = arg1"
  968.       call lineout 'DIRSIZE.CMD', "    arg1 = stream(arg1,'c','query exists')"
  969.       call lineout 'DIRSIZE.CMD', "    if arg1 = '' then"
  970.       call lineout 'DIRSIZE.CMD', "    do"
  971.       call lineout 'DIRSIZE.CMD', "      arg1 = directory(arg0)"
  972.       call lineout 'DIRSIZE.CMD', "      call directory mydir"
  973.       call lineout 'DIRSIZE.CMD', "    end"
  974.       call lineout 'DIRSIZE.CMD', "  end"
  975.       call lineout 'DIRSIZE.CMD', "end"
  976.       call lineout 'DIRSIZE.CMD', "else arg1 = mydir"
  977.       call lineout 'DIRSIZE.CMD', "n = setlocal()"
  978.       call lineout 'DIRSIZE.CMD', "n = directory('"curdir"')"
  979.       call lineout 'DIRSIZE.CMD', "'start dirsize.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  980.       call lineout 'DIRSIZE.CMD', "n = endlocal()"
  981.       call stream 'DIRSIZE.CMD','C','close'
  982.     end
  983.     else say "Couldn't create DIRSIZE.CMD file."
  984.     'del UNDEL.CMD 1>NUL 2>NUL'
  985.     dummy = stream('UNDEL.CMD','C','open')
  986.     if dummy = 'READY:' then
  987.     do
  988.       say 'Creating an UNDEL.CMD file.'
  989.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  990.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  991.       call lineout 'UNDEL.CMD', "'@echo off'"
  992.       call lineout 'UNDEL.CMD', "n = setlocal()"
  993.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  994.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  995.       call lineout 'UNDEL.CMD', "n = endlocal()"
  996.       call stream 'UNDEL.CMD','C','close'
  997.     end
  998.     else say "Couldn't create UNDEL.CMD file."
  999.     'del KILLPROC.CMD 1>NUL 2>NUL'
  1000.     dummy = stream('KILLPROC.CMD','C','open')
  1001.     if dummy = 'READY:' then
  1002.     do
  1003.       say 'Creating a KILLPROC.CMD file.'
  1004.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  1005.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  1006.       call lineout 'KILLPROC.CMD', "'@echo off'"
  1007.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  1008.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  1009.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  1010.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  1011.       call stream 'KILLPROC.CMD','C','close'
  1012.     end
  1013.     else say "Couldn't create KILLPROC.CMD file."
  1014.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  1015.     dummy = stream('VIEWINFS.CMD','C','open')
  1016.     if dummy = 'READY:' then
  1017.     do
  1018.       say 'Creating a VIEWINFS.CMD file.'
  1019.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  1020.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  1021.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  1022.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  1023.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  1024.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  1025.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  1026.       call stream 'VIEWINFS.CMD','C','close'
  1027.     end
  1028.     else say "Couldn't create VIEWINFS.CMD file."
  1029.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  1030.     dummy = stream('VIEWHELP.CMD','C','open')
  1031.     if dummy = 'READY:' then
  1032.     do
  1033.       say 'Creating a VIEWHELP.CMD file.'
  1034.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  1035.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  1036.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  1037.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  1038.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  1039.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  1040.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  1041.       call stream 'VIEWHELP.CMD','C','close'
  1042.     end
  1043.     else say "Couldn't create VIEWHELP.CMD file."
  1044.     'del GLOBAL.CMD 1>NUL 2>NUL'
  1045.     dummy = stream('GLOBAL.CMD','C','open')
  1046.     if dummy = 'READY:' then
  1047.     do
  1048.       say 'Creating a GLOBAL.CMD file.'
  1049.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  1050.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  1051.       call lineout 'GLOBAL.CMD', "'@echo off'"
  1052.       call lineout 'GLOBAL.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1053.       call lineout 'GLOBAL.CMD', "if arg1 \= '' then "
  1054.       call lineout 'GLOBAL.CMD', "do"
  1055.       call lineout 'GLOBAL.CMD', "  if left(arg1,1,1) \= '/' then"
  1056.       call lineout 'GLOBAL.CMD', "  do"
  1057.       call lineout 'GLOBAL.CMD', "    arg1 = stream(arg1,'c','query exists')"
  1058.       call lineout 'GLOBAL.CMD', "  end"
  1059.       call lineout 'GLOBAL.CMD', "end"
  1060.       call lineout 'GLOBAL.CMD', "else arg1 = directory()"
  1061.       call lineout 'GLOBAL.CMD', "if arg2 \= '' then "
  1062.       call lineout 'GLOBAL.CMD', "do"
  1063.       call lineout 'GLOBAL.CMD', "  if left(arg2,1,1) \= '/' then"
  1064.       call lineout 'GLOBAL.CMD', "  do"
  1065.       call lineout 'GLOBAL.CMD', "    arg2 = stream(arg2,'c','query exists')"
  1066.       call lineout 'GLOBAL.CMD', "  end"
  1067.       call lineout 'GLOBAL.CMD', "end"
  1068.       call lineout 'GLOBAL.CMD', "if arg3 \= '' then "
  1069.       call lineout 'GLOBAL.CMD', "do"
  1070.       call lineout 'GLOBAL.CMD', "  if left(arg3,1,1) \= '/' then"
  1071.       call lineout 'GLOBAL.CMD', "  do"
  1072.       call lineout 'GLOBAL.CMD', "    arg3 = stream(arg3,'c','query exists')"
  1073.       call lineout 'GLOBAL.CMD', "  end"
  1074.       call lineout 'GLOBAL.CMD', "end"
  1075.       call lineout 'GLOBAL.CMD', "if arg4 \= '' then "
  1076.       call lineout 'GLOBAL.CMD', "do"
  1077.       call lineout 'GLOBAL.CMD', "  if left(arg4,1,1) \= '/' then"
  1078.       call lineout 'GLOBAL.CMD', "  do"
  1079.       call lineout 'GLOBAL.CMD', "    arg4 = stream(arg4,'c','query exists')"
  1080.       call lineout 'GLOBAL.CMD', "  end"
  1081.       call lineout 'GLOBAL.CMD', "end"
  1082.       call lineout 'GLOBAL.CMD', "if arg5 \= '' then "
  1083.       call lineout 'GLOBAL.CMD', "do"
  1084.       call lineout 'GLOBAL.CMD', "  if left(arg5,1,1) \= '/' then"
  1085.       call lineout 'GLOBAL.CMD', "  do"
  1086.       call lineout 'GLOBAL.CMD', "    arg5 = stream(arg5,'c','query exists')"
  1087.       call lineout 'GLOBAL.CMD', "  end"
  1088.       call lineout 'GLOBAL.CMD', "end"
  1089.       call lineout 'GLOBAL.CMD', "if arg6 \= '' then "
  1090.       call lineout 'GLOBAL.CMD', "do"
  1091.       call lineout 'GLOBAL.CMD', "  if left(arg6,1,1) \= '/' then"
  1092.       call lineout 'GLOBAL.CMD', "  do"
  1093.       call lineout 'GLOBAL.CMD', "    arg6 = stream(arg6,'c','query exists')"
  1094.       call lineout 'GLOBAL.CMD', "  end"
  1095.       call lineout 'GLOBAL.CMD', "end"
  1096.       call lineout 'GLOBAL.CMD', "if arg7 \= '' then "
  1097.       call lineout 'GLOBAL.CMD', "do"
  1098.       call lineout 'GLOBAL.CMD', "  if left(arg7,1,1) \= '/' then"
  1099.       call lineout 'GLOBAL.CMD', "  do"
  1100.       call lineout 'GLOBAL.CMD', "    arg7 = stream(arg7,'c','query exists')"
  1101.       call lineout 'GLOBAL.CMD', "  end"
  1102.       call lineout 'GLOBAL.CMD', "end"
  1103.       call lineout 'GLOBAL.CMD', "if arg8 \= '' then "
  1104.       call lineout 'GLOBAL.CMD', "do"
  1105.       call lineout 'GLOBAL.CMD', "  if left(arg8,1,1) \= '/' then"
  1106.       call lineout 'GLOBAL.CMD', "  do"
  1107.       call lineout 'GLOBAL.CMD', "    arg8 = stream(arg8,'c','query exists')"
  1108.       call lineout 'GLOBAL.CMD', "  end"
  1109.       call lineout 'GLOBAL.CMD', "end"
  1110.       call lineout 'GLOBAL.CMD', "if arg9 \= '' then "
  1111.       call lineout 'GLOBAL.CMD', "do"
  1112.       call lineout 'GLOBAL.CMD', "  if left(arg9,1,1) \= '/' then"
  1113.       call lineout 'GLOBAL.CMD', "  do"
  1114.       call lineout 'GLOBAL.CMD', "    arg9 = stream(arg9,'c','query exists')"
  1115.       call lineout 'GLOBAL.CMD', "  end"
  1116.       call lineout 'GLOBAL.CMD', "end"
  1117.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  1118.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  1119.       call lineout 'GLOBAL.CMD', "'start global.exe' arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1120.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  1121.       call stream 'GLOBAL.CMD','C','close'
  1122.     end
  1123.     else say "Couldn't create GLOBAL.CMD file."
  1124.     say ""
  1125.     parse upper var curdir curdir
  1126.     say "Please add the directory"
  1127.     say "  "curdir"\UTILS"
  1128.     say "to your PATH in CONFIG.SYS."
  1129.     say "┌──────────────────────────────────────────────────────────────────┐"
  1130.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  1131.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  1132.     say "│proposed change allows it to be run from any command line, and for│"
  1133.     say "│other programs that might want to use FM/2 as its file manager to │"
  1134.     say "│find and run it easily.                                           │"
  1135.     say "└──────────────────────────────────────────────────────────────────┘"
  1136.     say "While you're in there, check your LIBPATH statement for a '.' entry..."
  1137.     if existed \= "TRUE" then
  1138.     do
  1139.       say ""
  1140.       /* remove next 6 lines for unattended use */
  1141.       call charout ,'  Press [Enter] for more...'
  1142.       dummy = ''
  1143.       do until dummy = '0d'x
  1144.         dummy = SysGetKey('NOECHO')
  1145.       end
  1146.       call charout ,'0d1b'x'[K'
  1147.       rc = stream('fatopt.exe','c','query exists')
  1148.       say   "┌────────────────────────────────────────────────────────────────┐"
  1149.       if rc = '' then
  1150.       do
  1151.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  1152.         say "│archive in this directory, also, in which case you should       │"
  1153.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  1154.       end
  1155.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  1156.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  1157.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  1158.       say   "└────────────────────────────────────────────────────────────────┘"
  1159.     end
  1160.     if existed = 'TRUE' then
  1161.     do
  1162.       say ''
  1163.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  1164.       say 'as instructed above, please ignore this rambling.'
  1165.     end
  1166.     say ""
  1167.     /* remove next 6 lines for unattended use */
  1168.     call charout ,'  Press [Enter] to continue...'
  1169.     dummy = ''
  1170.     do until dummy = '0d'x
  1171.       dummy = SysGetKey('NOECHO')
  1172.     end
  1173.     call charout ,'0d1b'x'[K'
  1174.   end
  1175.   else say "Couldn't create FM2.CMD file.  Panic."
  1176.   dummy = directory(curdir)
  1177. end
  1178. else say "Couldn't switch to "curdir"\utils"
  1179.  
  1180. /* type the install.dat file to show any critical info/notices */
  1181.  
  1182. /* NOTE:  remove following 8 lines for unattended use... */
  1183. rc = stream('install.dat','c','query exists')
  1184. if rc \= '' then
  1185. do
  1186.   'type install.dat'
  1187.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  1188.   /* remove next 6 lines for unattended use */
  1189.   call charout ,'  Press [Enter] to continue...'
  1190.   dummy = ''
  1191.   do until dummy = '0d'x
  1192.     dummy = SysGetKey('NOECHO')
  1193.   end
  1194.   call charout ,'0d1b'x'[K'
  1195. end
  1196.  
  1197. /* Final words */
  1198.  
  1199. say '┌──────────────────────────────────────────────────────────────────────────┐'
  1200. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  1201. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  1202. say '│                                                                          │'
  1203. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  1204. say '└──────────────────────────────────────────────────────────────────────────┘'
  1205. say "I'm done now."
  1206. say ''
  1207.  
  1208.